﻿@using PMS.Web.Models.Customers
@model CustomerModel
@{
    Layout = "_AdminHomeLayout";
}
@section CssLinks{
    <!-- 加 载 样 式-->
    <link rel="stylesheet" href="~/lib/PearAdminLayui/admin/css/load.css" />
    <!-- 布 局 样 式 -->
    <link rel="stylesheet" href="~/lib/PearAdminLayui/admin/css/admin.css" />
    <!-- 主 题 更 换 -->
    <style id="pearadmin-bg-color"></style>
}

<!-- 布 局 框 架 -->
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <!-- 顶 部 左 侧 功 能 -->
        <ul class="layui-nav layui-layout-left">
            <li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
        </ul>
        <!-- 顶 部 右 侧 菜 单 -->
        <div id="control" class="layui-layout-control"></div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide-xs">
                <a href="javascript:;" data-tips="刷新" data-action="refresh" class="toolgroup layui-icon layui-icon-refresh-1"></a>
            </li>
            <li class="layui-nav-item layui-hide-xs">
                <a href="javascript:;" data-tips="全屏" data-action="fullscreen" class="toolgroup layui-icon layui-icon-screen-full"></a>
            </li>
            <li class="layui-nav-item layui-hide-xs">
                <a href="javascript:;" data-tips="清理" data-action="clearcache" data-href="" class="toolgroup layui-icon layui-icon-delete"></a>
            </li>
            <li class="layui-nav-item layui-hide-xs">
                <a href="javascript:;" data-tips="隐藏" data-action="pinheader" class="toolgroup layui-icon layui-icon-triangle-d" style="transform: rotateX(180deg)"></a>
            </li>
            <li class="layui-nav-item">
                <!-- 头 像 -->
                <a href="javascript:;">
                    <img src="/images/default-avatar.jpg" class="layui-nav-img">
                </a>
                <!-- 功 能 菜 单 -->
                <dl class="layui-nav-child">
                    <dd><a user-menu-url="/backend/customermange/customer/myprofile" user-menu-id="5555" user-menu-title="基本资料">基本资料</a></dd>
                    <dd><a id="adminLogout" href="javascript:;" class="logout">注销登录</a></dd>
                </dl>
            </li>
            <!-- 主 题 配 置 -->
            <li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
        </ul>
    </div>

    <!-- 侧 边 区 域 -->
    <div class="layui-side layui-bg-black">
        <!-- 菜 单 顶 部 -->
        <div class="layui-logo">
            <!-- 图 标 -->
            <img class="logo" />
            <!-- 标 题 -->
            <span class="title"></span>
        </div>
        <!-- 菜 单 内 容 -->
        <div class="layui-side-scroll">
            <div id="sideMenu"></div>
        </div>
    </div>
    <!-- 视 图 页 面 -->
    <div class="layui-body">
        <!-- 内 容 页 面 -->
        <div id="content"></div>
    </div>
    <!-- 视图底部 -->
    <div class="layui-footer layui-text">
        Copyright © 2021 <a href="http://www.diaza.cn" target="_blank">PMSWeb</a> all rights reserved.
        <span class="pull-right">Version 1.0.1</span>
    </div>
    <!-- 遮 盖 层 -->
    <div class="pear-cover"></div>
    <!-- 加 载 动 画-->
    <div class="loader-main">
        <div class="loader"></div>
    </div>
</div>
<!-- 移 动 端 便 捷 操 作 -->
<div class="pear-collasped-pe collaspe">
    <a href="#" class="layui-icon layui-icon-shrink-right"></a>
</div>

@section Scripts{
    <!-- 框 架 初 始 化 -->
    <script type="text/javascript">
        layui.use(['admin', 'loading'], function () {
            var admin = layui.admin;
            var loading = layui.loading;
            const ymlPath = rootAppPath + "lib/PearAdminLayui/config/pear.config.yml";

            // 初始化顶部用户信息
            var timestamp = new Date().getTime();
            var avatarImgUrl = "@Model.AvatarImage.ThumbImageUrl" + "?t=" + timestamp;
            admin.setAvatar(avatarImgUrl, "@Model.NickName");
            admin.setConfigType("yml");
            admin.setConfigPath(ymlPath);
            admin.render();
            // 登出逻辑 
            admin.logout(function () {
                loading.block({ type: 1, elem: 'body', msg: '正在退出,祝您生活愉快' })
                if (window.PMSUtils) {
                    PMSUtils.sleep(1000).then(function () {
                        loading.blockRemove("body", 1000);
                        PMSUtils.redirect("/backend/logout");
                    });
                }
                // 注销逻辑 返回 true / false
                return true;
            })

            // 初始化消息回调
            admin.message();
            // 重写消息回调 [消息列表点击事件]
			// admin.message(function(id, title, context, form) {});
        });
    </script>
}